package com.jd.tank.abstractfactory;

import com.jd.tank.Direction;
import com.jd.tank.Group;
import com.jd.tank.ResourceMgr;

import java.awt.*;

/**
 * @program: MyTank
 * @description:
 * @author: 王术平
 * @create: 2021-01-13 18:16
 **/
public abstract class BaseTank {

    public static int WIDTH = ResourceMgr.goodTankU.getWidth();
    public static int HEIGHT = ResourceMgr.goodTankU.getHeight();

    private int x;
    private int y;
    private boolean living;
    private Rectangle rect;
    private Direction dir;
    private boolean moving;
    private Group group;

    public BaseTank(int x, int y, boolean living, Rectangle rect, Direction dir, boolean moving, Group group) {
        this.x = x;
        this.y = y;
        this.living = living;
        this.rect = rect;
        this.dir = dir;
        this.moving = moving;
        this.group = group;
    }

    /**
     * 画板渲染数据
     */
    public abstract void paint(Graphics g);
    public abstract void die();
    public abstract void fire();




    public boolean isLiving() {
        return living;
    }

    public void setLiving(boolean living) {
        this.living = living;
    }


    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public Rectangle getRect() {
        return rect;
    }

    public void setRect(Rectangle rect) {
        this.rect = rect;
    }

    public Direction getDir() {
        return dir;
    }

    public void setDir(Direction dir) {
        this.dir = dir;
    }

    public boolean isMoving() {
        return moving;
    }

    public void setMoving(boolean moving) {
        this.moving = moving;
    }

    public Group getGroup() {
        return group;
    }

    public void setGroup(Group group) {
        this.group = group;
    }


}
